/*
 * @(#)EmailMessageSenderComparator.java
 *
 * Copyright (c) 2004 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

package com.dcivision.upgrade.handler;

import com.dcivision.upgrade.UpgradeContext;

/**
 * @author      Brook.Huang
 * @company     DCIVision Limited
 * @creation    19/04/2007
 * @version     $Revision: 1.3 $
 */
public class UpgradeHandler4Application319To320 extends UpgradeHandlerBase {

  public UpgradeHandler4Application319To320(UpgradeContext upgradeContext) throws Exception {
    super(upgradeContext);
  }

  protected void upgradeBegin() throws Exception {
    upgradeContext.logReport("<p><b>UPGRADE START</b>\n", null);
  }

  protected void upgradeEnd() throws Exception {
    upgradeCommit();

    upgradeContext.setUpgradeCompleted(true);
    upgradeContext.logReport("<p><b>UPGRADE END</b></p>\n", null);
  }

  private void upgradeCommit() {
    try {
      upgradeContext.commit();
    } finally {
      upgradeContext.release();
    }
  }

}
